The JumpCDEF control definition function enables debugging of 'CDEF' resources at the source level.
Contents of the JumpCDEF folder
-------------------------------
- JumpCDEF Info: the documentation file you are reading now.
- JumpCDEF.p: Pascal source code for the JumpCDEF 'CDEF' resource.
- JumpCDEF.rsrc: ResEdit file with the compiled code of the JumpCDEF resource.
- JumpCDEF.π: THINK Pascal project for compiling the JumpCDEF resource.
- JumpCDEFIntf.p: Pascal source code for automating the 'CJMP' trick used by JumpCDEF
How to use the JumpCDEF CDEF
----------------------------
Include the JumpCDEF resource (found inside the JumpCDEF.rsrc file) and a custom resource of type 'CJMP', ID = 128 in the resource file of your test project. The 'CJMP' resource should be any long.
Include the source code of your control definition procedure in a test project, but with an entry point of (say) MyCDEFProc instead of Main.
In your test source, where Main is found plug the address of MyCDEFProc into the 'CJMP' resource, like:
If you have done things correctly, when the Control Manager tries to call the JumpCDEF control definition, it gets this code instead, which recovers the address of MyCDEFProc and calls it. Then you can use a source-level debugger to debug the 'CDEF' code. When it's working, change the 'CDEF' entry point to build a standalone resource.